import { pubRequire } from '@utils/public'
const baseUrl = '/depts'
//获取列表
export function getDepartsList(obj, callbBack, errBack) {
  return pubRequire('get', `${baseUrl}`, obj, callbBack, errBack)
}
//删除菜单
export function delDeparts(id, callBack, errBack) {
  return pubRequire('delete', `${baseUrl}/${id}`, '', callBack, errBack)
}
//部门名称是否重复
export function repeatDeparts(deptId, obj, callBack, errBack) {
  return pubRequire(
    'get',
    `${baseUrl}/${deptId}/verifications`,
    obj,
    callBack,
    errBack
  )
}
//获取详情
export function departsDetail(deptId, callBack, errBack) {
  return pubRequire('get', `${baseUrl}/${deptId}`, '', callBack, errBack)
}
//编辑菜单
export function editDeparts(deptId, obj, callBack, errBack) {
  return pubRequire('put', `${baseUrl}/${deptId}`, obj, callBack, errBack)
}
//新增菜单
export function addDeparts(obj, callBack, errBack) {
  return pubRequire('post', `${baseUrl}`, obj, callBack, errBack)
}
//获取部门信息树状结构
export function getTree(callbBack, errBack) {
  return pubRequire('get', `${baseUrl}/tree`, '', callbBack, errBack)
}
